package account.drools;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;

import account.model.AccountModel;

public class AccountDroolsInfo {
	
	public AccountModel accountModel;
	public ArrayList< String > messages = new ArrayList<String>();
	
	public void addMessage( String msg ) {
		messages.add(msg);
	}

	public AccountModel getAccountModel() {
		return accountModel;
	}

	public void setAccountModel(AccountModel accountModel) {
		this.accountModel = accountModel;
	}

	public ArrayList<String> getMessages() {
		return messages;
	}

	public void setMessages(ArrayList<String> messages) {
		this.messages = messages;
	}
	
	public Integer getValue() {
		return accountModel.getValue();
	}
	
	public Integer getCost() {
		return accountModel.getCost();
	}
	
	public Date getCurrentDate() {
		Date date = new Date();
		return date;
		//return new SimpleDateFormat("yyyy-MM-dd").format( new Date() );
	}
	
	public String getCurrentStringDate() {
		return new SimpleDateFormat("yyyy-MM-dd").format( getCurrentDate() );
	}
	
	public Date getStartDate() {
		return accountModel.getStart_date();
	}
	
	public Date getNextPeriodDate() {
		Calendar cal = Calendar.getInstance();
		cal.setTime(accountModel.getStart_date());
		cal.add( Calendar.DATE, accountModel.getPeriod());
		return cal.getTime();	
	}
	
	public String getNextPeriodStringDate() {
		return new SimpleDateFormat("yyyy-MM-dd").format(getNextPeriodDate() );
	}
	
	
	
}
